package priv.menguer.nullobject.controller;

/**
 * @Title CustomerFactory.java
 * @description TODO
 * @time 2018年10月26日 上午11:30:07
 * @author menguer@126.com
 * @version 1.0
 */
public class CustomerFactory {

	public static final String[] names = { "Rob", "Joe", "Julie" };

	public static AbstractCustomer getCustomer(String name) {
		for (int i = 0; i < names.length; i++) {
			if (names[i].equalsIgnoreCase(name)) {
				return new RealCustomer(name);
			}
		}
		return new NullCustomer();
	}
}
